//swren.h
#ifndef _SWREN_H_
#define _SWREN_H_

#ifdef swr_EXPORTS
#define SWR_API __declspec(dllexport)
#else
#define SWR_API __declspec(dllimport)
#endif

int SWR_API mkcolor(int r, int g, int b);

class MainWindow;
class SWR_API color_buffer
{
public:
	color_buffer(int w, int h);

	// set buffer size
	void set_buffer_size(int w, int h);
	
	// clear color buffer with specified color.
	void clear_color_buffer( int color );
	
	// set pixel color, orign is left bottom corner.
	void set_pixel_color( int x, int y, int color );

	// draw line DDA
	void draw_line( int x1, int y1, int x2, int y2, int color);

	// draw into the window.
	void draw(MainWindow* lpMainWnd);

	// color buffer memory
	int *m_lpMemory;
	
	// color buffer size
	int m_nSize;
	int m_nPitch;
};




#endif
